<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
		<head>
			<!-- template designed by Marco Von Ballmoos  -->
			<title>Actions</title>
			<link rel="stylesheet" href="../media/stylesheet.css" />
						<script src="../media/lib/classTree.js"></script>
												<script language="javascript" type="text/javascript">
				var imgPlus = new Image();
				var imgMinus = new Image();
				imgPlus.src = "../media/images/plus.png";
				imgMinus.src = "../media/images/minus.png";
				
				function showNode(Node){
							switch(navigator.family){
								case 'nn4':
									// Nav 4.x code fork...
							var oTable = document.layers["span" + Node];
							var oImg = document.layers["img" + Node];
									break;
								case 'ie4':
									// IE 4/5 code fork...
							var oTable = document.all["span" + Node];
							var oImg = document.all["img" + Node];
									break;
								case 'gecko':
									// Standards Compliant code fork...
							var oTable = document.getElementById("span" + Node);
							var oImg = document.getElementById("img" + Node);
									break;
							}
					oImg.src = imgMinus.src;
					oTable.style.display = "block";
				}
				
				function hideNode(Node){
							switch(navigator.family){
								case 'nn4':
									// Nav 4.x code fork...
							var oTable = document.layers["span" + Node];
							var oImg = document.layers["img" + Node];
									break;
								case 'ie4':
									// IE 4/5 code fork...
							var oTable = document.all["span" + Node];
							var oImg = document.all["img" + Node];
									break;
								case 'gecko':
									// Standards Compliant code fork...
							var oTable = document.getElementById("span" + Node);
							var oImg = document.getElementById("img" + Node);
									break;
							}
					oImg.src = imgPlus.src;
					oTable.style.display = "none";
				}
				
				function nodeIsVisible(Node){
							switch(navigator.family){
								case 'nn4':
									// Nav 4.x code fork...
							var oTable = document.layers["span" + Node];
									break;
								case 'ie4':
									// IE 4/5 code fork...
							var oTable = document.all["span" + Node];
									break;
								case 'gecko':
									// Standards Compliant code fork...
							var oTable = document.getElementById("span" + Node);
									break;
							}
					return (oTable && oTable.style.display == "block");
				}
				
				function toggleNodeVisibility(Node){
					if (nodeIsVisible(Node)){
						hideNode(Node);
					}else{
						showNode(Node);
					}
				}
			</script>
					</head>
		<body>
			<div class="page-body">			
	<table class="tutorial-nav-box">
	<tr>
		<td style="width: 30%">
							<a href="../Nexista/tutorial_validator.validator.pkg.html"><img src="../media/images/previous_button.png" alt="Previous"></a>
					</td>
		<td style="text-align: center">
							<a href="../Nexista/tutorial_reference.pkg.html"><img src="../media/images/up_button.png" alt="Up"></a>
					</td>
		<td style="text-align: right; width: 30%">
							<a href="../Nexista/tutorial_action.actions.pkg.html"><img src="../media/images/next_button.png" alt="Next"></a>
					</td>
	</tr>
	<tr>
		<td style="width: 30%">
							<span class="detail">validator</span>
					</td>
		<td style="text-align: center">
							<span class="detail">Reference</span>
					</td>
		<td style="text-align: right; width: 30%">
							<span class="detail">actions</span>
					</td>
	</tr>
</table>
	
<div><a name=""></a><div class="ref-title-box"><h1 class="ref-title">Actions</h1></div>
 
 <span><a name="overview"></a><h2 class="title">Overview</h2><p>Actions provide a mean to modify flow data from within the sitemap file. Their 
job is to transform data but never validate (see <a href="../Nexista/tutorial_validator.pkg.html">Validators</a>.</p>

<p>Actions are very easy to use. They consist of a action xml file used to describe 
the actions needed and a map:action tag to call this file at the appropriate 
place in the sitemap.xml file. Let's take a look at the structure of a action 
descriptor file.</p>
 <pre class="listing"><pre>
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;actions&gt;
     &lt;action type=&quot;fileupload&quot; params=&quot;file,/var/htdocs/uploads&quot;/&gt; 
&lt;/actions&gt;
</pre></pre>


<p>This file consists of a actions root tag and any number of action tags. 
Each action tag accepts a &quot;type&quot; parameter. This is the name of 
the desired action class as found in /base/mod/actions. The tag also needs a 
&quot;params&quot; value describing the parameters needed by the action in question.</p>
<p>To determine the necessary parameters, look at the comments in the action class 
itself. In the future, these will be available in the docs.
Once the action description file has been created (let's call this one myaction.xml) 
we'll need to call it from within the sitemap:</p>

 <pre class="listing"><pre>
&lt;map:gate match=&quot;somegate&quot;&gt;
     &lt;map:action src=&quot;myaction.xml&quot;/&gt;
          ... do something with data
&lt;/map:gate&gt;
</pre></pre>


<p>Some of the currently available actions are:</p>
<ul mark = "bullet"><li><p>escape - escapes bad an evil characters as in php's html_entities()</p></li>  
<li><p>rawxml - used to merge database stored xml with flow as one xml file</p></li>     
<li><p>xsl - applies xsl to some xml data</p></li>       
<li><p>md5 - returns the md5 of the data</p></li>       
<li><p>fileupload - handles file uploads</p></li>       
<li><p>newline - transforms linebreaks into newlines as in php's nl2br()</p></li></ul>

<p>All actions are extended from the base Action class (_action.php). To create 
your own actions, just look at the structure of the existing ones.</p></span>
<span><a name="reference"></a><h2 class="title">Reference</h2><p>This is a reference of all tags used in action definition files.</p>
<ul mark = "bullet"><li><p><a href="../Nexista/tutorial_action.actions.pkg.html">actions</a></p></li>  
<li><p><a href="../Nexista/tutorial_action.action.pkg.html">action</a></p></li></ul></span></div>

	<table class="tutorial-nav-box">
	<tr>
		<td style="width: 30%">
							<a href="../Nexista/tutorial_validator.validator.pkg.html"><img src="../media/images/previous_button.png" alt="Previous"></a>
					</td>
		<td style="text-align: center">
							<a href="../Nexista/tutorial_reference.pkg.html"><img src="../media/images/up_button.png" alt="Up"></a>
					</td>
		<td style="text-align: right; width: 30%">
							<a href="../Nexista/tutorial_action.actions.pkg.html"><img src="../media/images/next_button.png" alt="Next"></a>
					</td>
	</tr>
	<tr>
		<td style="width: 30%">
							<span class="detail">validator</span>
					</td>
		<td style="text-align: center">
							<span class="detail">Reference</span>
					</td>
		<td style="text-align: right; width: 30%">
							<span class="detail">actions</span>
					</td>
	</tr>
</table>
	
	<p class="notes" id="credit">
		Documentation generated on Wed, 03 May 2006 13:48:44 -0700 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.3.0RC3</a>
	</p>
	</div></body>
</html>